<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<script th:inline="javascript">
/*<![CDATA[*/
  $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
  $(function(){
	  battcn.admin.menu[[${OP.menuId}]].save = function(obj) {
		var $form = $("#menu[[${OP.menuId}]]Form");  		
  		if($form.valid()){
  			battcn.ajaxJson({url:"/op_save_[[${OP.menuId}]]",data:$form.serializeArray()},function(){
  				battcn.closeWindow();
				$('#admin_menu[[${OP.menuId}]]_datagrid').bootstrapTable('refresh');
    		});
  		}; 
	};	 
  });
/*]]>*/
</script>
<div class="ibox float-e-margins animated fadeInRight">
	<div class="ibox-content">
		<form class="form-horizontal m-t required-validate" th:id="@{menu{menuId}Form(menuId=${OP.menuId})}" method="POST" >
			<input type="hidden" name="id" th:value="${dto?.id}"/>
			<div class="form-group" th:if="${dto==null}">
				<label class="col-sm-3 control-label">菜单：</label>
				<div class="col-sm-8">
					<select class="form-control m-b" name="menuId" validate="{ required: true,messages:{required:'请选择菜单'}}">
						<option value="">请选择菜单</option>
						<option th:each="m : ${menus}" th:value="${m?.id}" th:selected="${m.id == dto?.menuId}" th:text="${m.name}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">操作名称：</label>
				<div class="col-sm-8">
					<input name="name" th:value="${dto?.name}" class="form-control"
						validate="{ required: true,maxlength:20,messages:{required:'请填写操作',maxlength:' '}}"
						type="text"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">代码：</label>
				<div class="col-sm-8">
					<input name="op" th:value="${dto?.op}" class="form-control"
						validate="{ required: true,maxlength:20,messages:{required:'请填写操作代码',maxlength:' '}}"
						type="text"/>
					<div class="help-block m-b-none">
						<i class="fa fa-info-circle"></i> 比如list add edit remove save 等
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">图标：</label>
				<div class="col-sm-8">
					<input name="icon" th:value="${dto?.icon}" class="form-control"
						type="text"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">排序：</label>
				<div class="col-sm-8">
					<input name="ordno" th:value="${dto?.ordno}" class="form-control"
						type="text"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">状态：</label>
				<div class="col-sm-8">
					<div class="radio i-checks radio-inline">
						<label><input type="radio" value="1" th:checked="${dto?.display}" name="display" /><i></i> 显示 </label>
					</div>
					<div class="radio i-checks radio-inline">
						<label><input type="radio" value="0" th:checked="${dto?.display != true}" name="display" /><i></i> 隐藏 </label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea name="remark" cols="55" rows="3" style="resize: vertical;" class="form-control" th:text="${dto?.remark}"></textarea>
				</div>
			</div>
		</form>
	</div>
</div>
</html>